# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-webauthn
_pyname=webauthn
pkgver=2.2.0
pkgrel=0
arch="noarch"
pkgdesc="A Python3 implementation of the WebAuthn API focused on making it easy to leverage the power of WebAuthn."
url="https://pypi.python.org/project/webauthn"
license="BSD-3-Clause"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-cbor2
	py3-openssl
	py3-asn1crypto
"
source="$pkgname-$pkgver-gh.tar.gz::https://github.com/duo-labs/py_webauthn/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/py_webauthn-$pkgver
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
86c5e2c2f670565dd5dbb3b92227464c56120dc5c7dae98b8e4b97931486c7e5f352c4261152406894a79676004391daada8e5ac89ed745548ea90668c03de08  py3-webauthn-2.2.0-gh.tar.gz
"
